package com.mall.business.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
        import com.mall.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.mall.business.mapper.TCashbackRuleMapper;
import com.mall.business.domain.TCashbackRule;
import com.mall.business.service.ITCashbackRuleService;

/**
 * 邀请返现规则Service业务层处理
 *
 * @author ruoyi
 * @date 2025-03-31
 */
@Service
public class TCashbackRuleServiceImpl extends ServiceImpl<TCashbackRuleMapper,TCashbackRule>  implements ITCashbackRuleService
{
    @Autowired
    private TCashbackRuleMapper tCashbackRuleMapper;

    /**
     * 查询邀请返现规则
     *
     * @param id 邀请返现规则主键
     * @return 邀请返现规则
     */
    @Override
    public TCashbackRule selectTCashbackRuleById(String id)
    {
        return tCashbackRuleMapper.selectTCashbackRuleById(id);
    }

    /**
     * 查询邀请返现规则列表
     *
     * @param tCashbackRule 邀请返现规则
     * @return 邀请返现规则
     */
    @Override
    public List<TCashbackRule> selectTCashbackRuleList(TCashbackRule tCashbackRule)
    {
        return tCashbackRuleMapper.selectTCashbackRuleList(tCashbackRule);
    }

    /**
     * 新增邀请返现规则
     *
     * @param tCashbackRule 邀请返现规则
     * @return 结果
     */
    @Override
    public int insertTCashbackRule(TCashbackRule tCashbackRule)
    {
                tCashbackRule.setCreateTime(DateUtils.getNowDate());
            return tCashbackRuleMapper.insertTCashbackRule(tCashbackRule);
    }

    /**
     * 修改邀请返现规则
     *
     * @param tCashbackRule 邀请返现规则
     * @return 结果
     */
    @Override
    public int updateTCashbackRule(TCashbackRule tCashbackRule)
    {
                tCashbackRule.setUpdateTime(DateUtils.getNowDate());
        return tCashbackRuleMapper.updateTCashbackRule(tCashbackRule);
    }

    /**
     * 批量删除邀请返现规则
     *
     * @param ids 需要删除的邀请返现规则主键
     * @return 结果
     */
    @Override
    public int deleteTCashbackRuleByIds(String[] ids)
    {
        return tCashbackRuleMapper.deleteTCashbackRuleByIds(ids);
    }

    /**
     * 删除邀请返现规则信息
     *
     * @param id 邀请返现规则主键
     * @return 结果
     */
    @Override
    public int deleteTCashbackRuleById(String id)
    {
        return tCashbackRuleMapper.deleteTCashbackRuleById(id);
    }
}
